// utils/map.js
const QQMapWX = require('../static/libs/qqmap-wx-jssdk.js');

// 初始化 SDK
const qqmapsdk = new QQMapWX({
  key: 'ZQWBZ-NQBLV-W7CPF-U7QIR-5HBNQ-AOFUE' // 替换成你的 key
});

// 示例：逆地理编码
export const reverseGeocoder = (location) => {
  return new Promise((resolve, reject) => {
    qqmapsdk.reverseGeocoder({
      location,
      success: resolve,
      fail: reject,
    });
  });
};

// 导出 SDK 实例
export default qqmapsdk;